package study.javase.io;

import java.io.File;
import java.io.IOException;

/**
 *
 * 测试 File
 * @author LiShaowen
 * @date 2020/9/7 21:32
 */
public class FIleTest {
    public static void main(String[] args) throws IOException {

        // 构建File对象 001
        File file = new File("E:/IDEAProject/java/src/main/java/study.javase/io/LIshaowen.jpg");
        System.out.println(file.length());
        // 构建File对象 002
         file = new File("E:/IDEAProject/java/src/main/java/study.javase/io"+"/LIshaowen.jpg");
        System.out.println(file.length());
        // 构建File对象 003
         file = new File("E:/IDEAProject/java/src/main/java/study.javase/"+"io/LIshaowen.jpg");
        System.out.println(file.length());
        // 构建File对象 004
        file = new File(new File("E:/IDEAProject/java/src/main/java/study.javase/io/"),"LIshaowen.jpg");
        System.out.println(file.length());

        //
        System.out.println(System.getProperty("user.dir"));

        file = new File("io.txt");
        file.createNewFile();
    }

}
